<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <title>骨医快线</title>
    <link href="../../../css/mui.plus.css" rel="stylesheet" />
    <style>
    	.mui-grid-view.mui-grid-9 .mui-table-view-cell {
    		padding: 0;
    	}
    	.mui-grid-view.mui-grid-9 {
    		background-color: #fff;
    	}
    </style>
</head>
<body>
	<header class="mui-bar mui-bar-nav oe-pri-bar">
	    <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
	    <h1 class="mui-title">新建病例</h1>
	</header>
	
    <div class="mui-content">
		<ul id="btns-module" class="mui-table-view mui-grid-view mui-grid-9">
            <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3" data-page = "case-info.html" data-type="admission">
            	<a href="#">
            		<img src="../../../images/club/case-info.png"/>
            	</a>
            </li>
            <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3" data-page = "case-complications.html" data-type="complication">
            	<a href="#">
            		<img src="../../../images/club/case-complications.png"/>
            	</a>
            </li>
            <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3" data-page = "case-preoperative.html" data-type="pre_op">
            	<a href="#">
            		<img src="../../../images/club/case-preoperative.png"/>
            	</a>
            </li>
            <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3" data-page = "case-intraoperative.html" data-type="mid_op">
            	<a href="#">
            		<img src="../../../images/club/case-intraoperative.png"/>
            	</a>
            </li>
            <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3" data-page = "case-postoperative-1.html" data-type="post_op_1day">
            	<a href="#">
            		<img src="../../../images/club/case-postoperative-1.png"/>
            	</a>
            </li>
            <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3" data-page = "case-postoperative-3.html" data-type="post_op_3day">
            	<a href="#">
            		<img src="../../../images/club/case-postoperative-3.png"/>
            	</a>
            </li>
            <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3" data-page = "case-postoperative-5.html" data-type="post_op_5day">
            	<a href="#">
            		<img src="../../../images/club/case-postoperative-5.png"/>
            	</a>
            </li>
            <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3" data-page = "case-follow-up.html" data-type="followup">
            	<a href="#">
            		<img src="../../../images/club/case-follow-up.png"/>
            	</a>
            </li>
            <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3" data-page = "case-info-orther.html" data-type="other">
            	<a href="#">
            		<img src="../../../images/club/case-info-other.png"/>
            	</a>
            </li>
        </ul>
    </div>
    

    <script src="../../../js/mui.min.js"></script>
    <script src="../../../js/app.js"></script>
    <script src="../../../js/lib/template.js"></script>
    <script>
    	(function($, a){
    		var wv,
    			caseId,
    			actionType,
    			hasAdmissionInfo = false;
    			
    		window.addEventListener('hasAdmissionInfo', function(){
    			hasAdmissionInfo = true;
    		})
    		
    		$.oldBack = $.back;
    		$.back = function(){
    			var lastPage = plus.webview.getWebviewById('proGHF/home.html');
    			$.fire(lastPage, 'refreshCase');
    			$.oldBack()
    		}
    		
    		$.plusReady(function(){
    			wv = plus.webview.currentWebview();
    			caseId = wv.case_id;
    			actionType = wv.action_type;
				
				$('.mui-content').on('tap', 'li', function(){
					var url = this.dataset.page,
						type = this.dataset.type;
					
					//  权限控制，用户如果在新建病历时没有填写基本信息，无法进入其他模块
					if(type !== 'admission' && actionType !== 'check' && !hasAdmissionInfo) return $.toast('请先填写入院信息')	
					
					$.openWindow({
						url: url,
						waiting: {
							autoShow: false
						},
						extras: {
							caseId: caseId,
							type: type
						}
					});
				});
    		});
    	}(mui, app));
    </script>
</body>
</html>